import {Http} from "@angular/http";
import {Injectable} from "@angular/core";

@Injectable()
export class WeatherHttp{
  http: Http;

  constructor(http: Http){
    this.http = http;
  }

  searchWeather(cityName: string){
    const weatherUrl = `http://wthrcdn.etouch.cn/weather_mini?city=${cityName}`;
    return this.http.get(weatherUrl);
  }
}
